import { request } from '@/service/request';

const SERVICE = 'carbon-misc';

const BASE_URL = '/private/admin/oss/config';

export async function page(params: any) {
  return (await request<Carbon.ResponseData<Carbon.PageData<any>>>({ url: `${SERVICE}${BASE_URL}/page`, params }))
    .data!;
}

export async function detail(params: any) {
  return (await request<any>({ url: `${SERVICE}${BASE_URL}/detail`, params })).data;
}

export async function create(params: any) {
  return (await request<any>({ url: `${SERVICE}${BASE_URL}/create`, method: 'post', data: params })).data;
}

export async function update(params: any) {
  return (await request<any>({ url: `${SERVICE}${BASE_URL}/update`, method: 'post', data: params })).data;
}

export async function remove(params: any) {
  return (await request<any>({ url: `${SERVICE}${BASE_URL}/delete`, method: 'post', data: params })).data;
}
